﻿using FluentNHibernate.Mapping;
using MediaMover.Common;

namespace MediaMover.Data.NHIbernate.Mappings
{
    public class SettingsMap : ClassMap<Settings>
    {
        public SettingsMap()
        {
            Table("Settings");
            Id().Column("SettingsID").GeneratedBy.Identity();
            HasMany(x => x.SearchLocations).Element("Path").KeyColumn("ParentID").Table("ScanFolders").Cascade.AllDeleteOrphan().Not.LazyLoad();
            Map(x => x.MovieBaseLocation).Column("MovieBaseLocation");
            Map(x => x.TvBaseLocation).Column("TvBaseLocation");
        }
    }
}